package com.mz.ozy.bean;

import com.mz.ozy.utils.CalendarUtils;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2018/11/20.
 */

public class FirmGoodsBean {

    private String date;

    private List<FirmOrderBean.ProductMapBean> carList = new ArrayList<>();

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public List<FirmOrderBean.ProductMapBean> getCarList() {
        return carList;
    }

    public void setCarList(List<FirmOrderBean.ProductMapBean> carList) {
        this.carList = carList;
    }

    public void addProduct(FirmOrderBean.ProductMapBean productMapBean) {
        this.carList.add(productMapBean);
    }

    public String getFormatDate() {
        Date curDate = null;
        try {
            curDate = CalendarUtils.string2Date(date);
        } catch (ParseException e) {
        }
        if (curDate == null) {
            return null;
        } else {
            return CalendarUtils.date2String(curDate);
        }
    }
}
